babl: export more symbols
authorØyvind Kolås <pippin@gimp.org>
Sun, 8 Jul 2018 13:54:58 +0000 (15:54 +0200)
committerØyvind Kolås <pippin@gimp.org>
Sun, 8 Jul 2018 14:09:09 +0000 (16:09 +0200)
Adding babl_chromaticities_make_space, babl_trc and
babl_trc_gamma to public api and ability to setup arbitrary
BablSpaces without loading from ICC profiles.

babl/babl-icc.c
babl/babl-internal.h
babl/babl-space.c
babl/babl.h
export-symbols

index 973da7f3cf8b1382072d43fbcf560d511e0be1ed..918b81ed7c9ef2d7260b565e79d9ddd2ca52895d 100644 (file)
@@ -883,7 +883,7 @@ babl_icc_make_space (const char   *icc_data,
        double wZ = icc_read (s15f16, offset + 8 + 4 * 2);
        babl_free (state);
 
-       ret = (void*) babl_space_from_chromaticities (NULL,
+       ret = (void*) babl_chromaticities_make_space (NULL,
                      wX / (wX + wY + wZ),
                      wY / (wX + wY + wZ),
                      red_x, red_y,
index 150fabdccb04a708a24bfa491516041f6d32a566..8645f902beacdeb66c9350d5b844af155c01948b 100644 (file)
@@ -386,26 +386,6 @@ const Babl *babl_space_match_trc_matrix (const Babl *trc_red,
                                          float gx, float gy, float gz,
                                          float bx, float by, float bz);
 
-/**
- * babl_space_from_chromaticities:
- *
- * Creates a new babl-space/ RGB matrix color space definition with the
- * specified CIE xy(Y) values for white point: wx, wy and primary
- * chromaticities: rx,ry,gx,gy,bx,by and TRCs to be used. After registering a
- * new babl-space it can be used with babl_space() passing its name;
- *
- * Internally this does the math to derive the RGBXYZ matrix as used in an ICC
- * profile.
- */
-const Babl * babl_space_from_chromaticities (const char *name,
-                                             double wx, double wy,
-                                             double rx, double ry,
-                                             double gx, double gy,
-                                             double bx, double by,
-                                             const Babl *trc_red,
-                                             const Babl *trc_green,
-                                             const Babl *trc_blue,
-                                             int equalize_matrix);
 
 /**
  * babl_space_from_rgbxyz_matrix:
@@ -424,21 +404,6 @@ babl_space_from_rgbxyz_matrix (const char *name,
                                const Babl *trc_green,
                                const Babl *trc_blue);
 
-/**
- * babl_trc_gamma:
- *
- * Creates a Babl TRC for a specific gamma value, it will be given
- * a name that is a short string representation of the value.
- */
-const Babl * babl_trc_gamma (double gamma);
-
-/**
- * babl_trc:
- *
- * Look up a TRC by name, "sRGB" "1.0" "linear" and "2.2" are recognized
- * strings in a stock babl configuration.
- */
-const Babl * babl_trc       (const char *name);
 
 int _babl_file_get_contents (const char  *path,
                              char       **contents,
index 5d5086a6993d34d15e444d1b8a1c4ec051043406..7e96832da17e2e00dd4037e628536e5c89caf1d8 100644 (file)
@@ -300,7 +300,7 @@ babl_space_from_rgbxyz_matrix (const char *name,
 }
 
 const Babl *
-babl_space_from_chromaticities (const char *name,
+babl_chromaticities_make_space (const char *name,
                                 double wx, double wy,
                                 double rx, double ry,
                                 double gx, double gy,
@@ -377,14 +377,14 @@ void
 babl_space_class_init (void)
 {
 #if 0
-  babl_space_from_chromaticities ("sRGB",
+  babl_chromaticities_make_space ("sRGB",
                0.3127,  0.3290, /* D65 */
                0.6400,  0.3300,
                0.3000,  0.6000,
                0.1500,  0.0600,
                babl_trc("sRGB"), NULL, NULL, 1);
 #else
-  babl_space_from_chromaticities ("sRGB",
+  babl_chromaticities_make_space ("sRGB",
                 0.3127,  0.3290, /* D65 */
                 0.639998686, 0.330010138,
                 0.300003784, 0.600003357,
@@ -394,7 +394,7 @@ babl_space_class_init (void)
   /* hard-coded pre-quantized values - to match exactly what is used in standards see issue #18 */
 #endif
 
-  babl_space_from_chromaticities ("Rec2020",
+  babl_chromaticities_make_space ("Rec2020",
                0.3127,  0.3290, /* D65 */
                0.708,  0.292,
                0.170,  0.797,
@@ -402,7 +402,7 @@ babl_space_class_init (void)
                // XXX: is using sRGB TRC right?
                babl_trc("sRGB"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
       "Adobish",  /* a space that can be used as a place-holder for a sRGB like
 space with displaced green coordinates from a big graphics software vendor that
 would rather not it's name be directly used when referring to this color space,
@@ -414,7 +414,7 @@ computations of uniform gray axis */
       0.1500,  0.0600,
       babl_trc("2.2"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
       "ProPhoto",
       0.34567, 0.3585,  /* D50 */
       0.7347,  0.2653,
@@ -422,7 +422,7 @@ computations of uniform gray axis */
       0.0366,  0.0001,
       babl_trc("1.8"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
       "Apple",
       0.3127,  0.3290, /* D65 */
       0.6250,  0.3400,
@@ -431,7 +431,7 @@ computations of uniform gray axis */
       babl_trc("1.8"), NULL, NULL, 1);
 
 #if 0
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
      "WideGamut",
      0.34567, 0.3585,  /* D50 */
      0.7350,  0.2650,
@@ -439,7 +439,7 @@ computations of uniform gray axis */
      0.1570,  0.0180,
      babl_trc("2.2"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
       "Best",
       0.34567, 0.3585,  /* D50 */
       0.7347,  0.2653,
@@ -447,7 +447,7 @@ computations of uniform gray axis */
       0.1300,  0.0350,
       babl_trc("2.2"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
       "Beta",
       0.34567, 0.3585,  /* D50 */
       0.6888,  0.3112,
@@ -455,7 +455,7 @@ computations of uniform gray axis */
       0.1265,  0.0352,
       babl_trc("2.2"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
       "Bruce",
       0.3127,  0.3290, /* D65 */
       0.6400,  0.3300,
@@ -463,7 +463,7 @@ computations of uniform gray axis */
       0.1500,  0.0600,
       babl_trc("1.8"), NULL, NULL);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
       "PAL",
       0.3127,  0.3290, /* D65 */
       0.6400,  0.3300,
@@ -471,7 +471,7 @@ computations of uniform gray axis */
       0.1500,  0.0600,
       babl_trc("2.2"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
       "SMPTE-C",
       0.3127,  0.3290, /* D65 */
       0.6300,  0.3300,
@@ -479,7 +479,7 @@ computations of uniform gray axis */
       0.1550,  0.0700,
       babl_trc("2.2"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
       "ColorMatch",
       0.34567, 0.3585,  /* D50 */
       0.6300,  0.3400,
@@ -487,7 +487,7 @@ computations of uniform gray axis */
       0.1500,  0.0750,
       babl_trc("1.8"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
      "Don RGB 4",
      0.34567, 0.3585,  /* D50 */
      0.6960,  0.3000,
@@ -496,7 +496,7 @@ computations of uniform gray axis */
      babl_trc("1.8"), NULL, NULL, 1);
 #endif
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
      "ACEScg",
       0.32168, 0.33767,
       0.713, 0.293,
@@ -504,7 +504,7 @@ computations of uniform gray axis */
       0.128, 0.044,
       babl_trc("linear"), NULL, NULL, 1);
 
-  babl_space_from_chromaticities (
+  babl_chromaticities_make_space (
      "ACES2065-1",
       0.32168, 0.33767,
       0.7347, 0.2653,
index 39cb097729bcea73d193e69729c00b8679107096..1d7d43394c0ce64fcf46ce9b3b447ec038b84f5d 100644 (file)
@@ -450,6 +450,44 @@ void   babl_set_user_data     (const Babl *babl, void *data);
 void * babl_get_user_data     (const Babl *babl);
 
 
+/**
+ * babl_space_from_chromaticities:
+ *
+ * Creates a new babl-space/ RGB matrix color space definition with the
+ * specified CIE xy(Y) values for white point: wx, wy and primary
+ * chromaticities: rx,ry,gx,gy,bx,by and TRCs to be used. After registering a
+ * new babl-space it can be used with babl_space() passing its name;
+ *
+ * Internally this does the math to derive the RGBXYZ matrix as used in an ICC
+ * profile.
+ */
+const Babl * babl_chromaticities_make_space  (const char *name,
+                                              double wx, double wy,
+                                              double rx, double ry,
+                                              double gx, double gy,
+                                              double bx, double by,
+                                              const Babl *trc_red,
+                                              const Babl *trc_green,
+                                              const Babl *trc_blue,
+                                              int equalize_matrix);
+
+
+/**
+ * babl_trc_gamma:
+ *
+ * Creates a Babl TRC for a specific gamma value, it will be given
+ * a name that is a short string representation of the value.
+ */
+const Babl * babl_trc_gamma (double gamma);
+
+/**
+ * babl_trc:
+ *
+ * Look up a TRC by name, "sRGB" "1.0" "linear" and "2.2" are recognized
+ * strings in a stock babl configuration.
+ */
+const Babl * babl_trc       (const char *name);
+
 #ifdef __cplusplus
 }
 #endif
index 1b3622bdccf8208a84204c2842a3e6ca6279d7f0..952aeb6ad8c35c389eec6ddb344df057b453c471 100644 (file)
@@ -41,12 +41,14 @@ babl_sampling
 babl_set_user_data
 babl_space
 babl_space_from_xyz
+babl_chromaticities_make_space
 babl_space_get_rgbtoxyz
 babl_space_to_xyz
 babl_ticks
 babl_type
 babl_type_new
 babl_trc
+babl_trc_gamma
 babl_space_to_icc
 babl_db_exist_by_name
 babl_db_find